package com.sense.kukoo.biz_media.model

import com.sense.kukoo.common.mvvm.model.BaseMvvmModel
import com.sense.kukoo.common.repo.bean.ResultBean
import com.sense.kukoo.common.repo.http.KukooHttpApi
import com.sense.kukoo.common.repo.http.KukooHttpManager
import com.sense.kukoo.common.repo.http.bean.IndexContentBean
import com.sense.kukoo.common.repo.http.bean.LoginResultBean
import com.sense.kukoo.common.repo.http.bean.UserInfoBean
import okhttp3.RequestBody

class MediaChannelModel: BaseMvvmModel() {

    private val TAG: String = javaClass.simpleName

    override fun onModelCleared() {}

    suspend fun getUserInfo(userId: Long): ResultBean<UserInfoBean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .getUserInfo("${userId}")
    }

    suspend fun getUserContent(
        pageIndex: Int,
        pageSize: Int,
        userId: Long,
    ): ResultBean<List<IndexContentBean>> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .userSearchById("${pageIndex}", "${pageSize}", "${userId}")
    }

    suspend fun subscription(
        userId: Long
    ): ResultBean<Boolean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .subscription("${userId}")
    }

    suspend fun isSubscription(
        userId: Long
    ): ResultBean<Boolean> {
        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .isSubscription("${userId}")
    }
}